package com.lingrit.provider.exception;

/**
 * @author JuiceYan
 * @date 2018/04/11
 */
public enum ExceptionMsg {
    SUCCESS(0),
    FAILED(400),

    //参数错误
    PARAM_ERR(1),
    //header错误
    HEADER_ERR(2),
    //校验json数据错误
    JSONDATA_ERR(3),
    //Json数据与表字段不对应
    JSON_NON_TABLE_COLUMN(4),
    //添加数据不超过1000
    ADD_NOT_PASS(5),
    //更新数据不超过1000
    UPDATE_NOT_PASS(6),
    //ip在白名单中不存在
    IP_NOT_FOUND(7),
    //添加数据报错
    ADD_ERR(8),
    UPDATE_ERR(9),

    USER_EXIST(10, "用户已经存在！"),
    DATA_ERR(11, "数据不对应"),
    USER_UPDATE(12, "用户信息更新失败！"),

    TOKEN_CREATE(13, "token创建失败！"),
    TOKEN_VERIFY(14, "token校验不通过！"),

    //目标表不存在或不为一
    NOT_TARGER_TABLE(20),



    ;
    private Integer code;

    private String message;

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    private ExceptionMsg(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    private ExceptionMsg(Integer code) {
        this.code = code;
    }

}
